import java.util.Arrays;
import java.util.Scanner;


public class Paixu {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		//  排序  二分查找
		 int  [] shu = {88,66,11,99,33};
		
		 //  1   冒泡排序   
		    /* for(int i=0;i<shu.length-1;i++){
		    	 for(int j=0;j<shu.length-1-i;j++){
		    		 if(shu[j]>shu[j+1]){
		    			 int kong = shu[j];
		    			 shu[j] =shu[j+1];
		    			 shu[j+1] = kong;
		    		 }
		    	 }
		     }
		      
		     for(int xin :shu ){
		    	 System.out.print(xin+"\t");
		     }*/
		      
		    // 2 选择排序      //j  = i+1  ;  xia   =i  ;所以内循环要重后一位开始
	/*	    int xia   = -1;
		    for(int i=0;i<shu.length-1;i++){
		    	xia =i;
		    	for(int j=i+1;j<shu.length;j++){
		    		if(shu[xia]>shu[j]){
		    			xia =j;
		    			
		    		}
		    	}
		    	if(xia   != -1){
		    		int kongZ  = shu[xia];
		    		shu[xia] = shu[i];
		    		shu[i] = kongZ;
		    	}
		    }
		    for(int xin :shu ){
		    	 System.out.print(xin+"\t");
		    }
	*/
	
	    // 3 Arrays 
		 
		 /*Arrays.sort(shu);
		 for(int xin :shu ){
	    	 System.out.print(xin+"\t");
	    }
		 */
	    
		  // 二分查找  
/*		 Arrays.sort(shu);
		 int qi = 0;
		 int zhong  = shu.length-1;
		 int jian = -1;
		 boolean  falg  =false;
		 System.out.println("请输入你要查找的数：");
		   int cha   = input.nextInt();
		  
		do{
			jian = (qi+zhong)/2;
		   if(shu[jian]==cha){
			   System.out.println("恭喜你查到了，下标是："+jian);
			   falg = true;
			      break; 
		   }else if(shu[jian]>cha){
			   zhong = jian-1;
		   }else{
			   qi = jian+1;
		   }
		   
		}while(qi<=zhong);
		 if(!falg){
			 System.out.println("没有查找的数");
		 }
		 
	*/
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	}
       
}
